
#ifndef _PIPELINE_PORT_
#define _PIPELINE_PORT_

#include "BasicPort.h"
#include "ParametrizedOutput.h"

namespace ttg
{
	namespace pipeline
	{
		//Class, which allows sending data between arbitrary nodes.
		template <class T>
		class Port :public ttg_internal::pipeline::BasicPort
		{
			private:
				ttg_internal::pipeline::ParametrizedOutput<T> *ptarget;
			public:
				//Creates port for given node.
				inline Port(ttg_internal::pipeline::ParametrizedOutput<T> *target)
					:BasicPort(target)
						{ this->ptarget = target; }
				//Sends data to connected node.
				inline void send(T data)
						{ ptarget->addTaskData(data); }
				//Sends data to connected node.
				inline void send(std::vector<T> &data)
						{ ptarget->addTaskData(ttg::structures::StlEnumerator<T, vector<T>>(data)); }
				//Sends data to connected node.
				inline void send(std::list<T> &data)
						{ ptarget->addTaskData(ttg::structures::StlEnumerator<T, list<T>>(data)); }
		};
	}
}

#endif
